<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>消息框</title>
    <script>
        function f1(){
            alert("警告框");
        }
        function f2(){
            let flag = confirm("是否确认");
            console.log(flag);
        }
        function f3(){
            // let s = prompt("请输入一个字符串");
            let s = prompt("请输入一个字符串","默认值");
            console.log(s);
        }
    </script>
</head>
<body>
<button onclick="f1()">警告框</button><br>
<button onclick="f2()">确认框</button><br>
<button onclick="f3()">输入框</button><br>
</body>
</html>